package com.geek.mpdemo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.Date;

@Data
public class User {

    @TableId(type = IdType.ID_WORKER)  //mp自带策略，生成19位值，id是数字类型使用这种，比如long
    //@TableId(type = IdType.ID_WORKER_STR)   //针对字符串
    private Long id;

    private String name;
    private Integer age;
    private String email;

    //create_time
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version; //版本号


    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

}
